# -*- coding:utf-8 -*-
# @FileName  :first_page.py
# @Time      :2020/12/14 15:20
# @Author    :Zhoujirong
# @Desc      :

from common.http_request import Request
from biz.support.urls import ServerUrl


class FirstPageRequest:
    @classmethod
    def get_version(cls, param, cookie):
        param = {
            'param': param
        }
        req = Request(ServerUrl.get_systemversion_url, data=param, headers=cookie)
        return req.post()

    @classmethod
    def get_menu(cls, sysNo, cookie):
        param = {
            'sysNo': sysNo
        }
        req = Request(ServerUrl.get_menu_url, params=param, headers=cookie)
        return req.get()

    @classmethod
    def get_menu_root(cls, cookie):
        req = Request(ServerUrl.get_menu_root_url, headers=cookie)
        return req.post()

    @classmethod
    def get_home(cls, cookie):
        req = Request(ServerUrl.get_home_url, headers=cookie)
        return req.get()

    @classmethod
    def get_notice(cls, curPage, maxSize, cookie):
        data = {
            'curPage': curPage,
            'maxSize': maxSize
        }
        req = Request(ServerUrl.get_notice_url, params=data, headers=cookie)
        return req.get()

    @classmethod
    def get_shortcut_menu(cls, root, cookie):
        '''获取拥有的快捷菜单'''
        data = {
            'root': root
        }
        req = Request(ServerUrl.get_shortcut_menu_url, data=data, headers=cookie)
        return req.post_list()

    @classmethod
    def edit_shortcut(cls, root, cookie):
        '''编辑快捷菜单'''
        data = {
            'root': root
        }
        req = Request(ServerUrl.edit_shortcut_url, params=data, headers=cookie)
        return req.get()

    @classmethod
    def get_user_link_menu(cls, root, cookie):
        '''所有可编辑的快捷菜单'''
        data = {
            'root': root
        }
        req = Request(ServerUrl.get_shortcut_menu_url, data=data, headers=cookie)
        return req.post_list()

    @classmethod
    def save_shortcut(cls,menuIds,root,cookie):
        '''保存快捷菜单'''
        data ={
            'menuIds':menuIds,
            'root':root
        }
        req = Request(ServerUrl.save_shortcut_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def get_nick_by_username(cls, cookie):
        req = Request(ServerUrl.get_nick_by_username_url, headers=cookie)
        return req.post()

    @classmethod
    def get_platprojectname(cls, cookie):
        req = Request(ServerUrl.get_platprojectname_url, headers=cookie)
        return req.post()

    @classmethod
    def get_current_user(cls, cookie):
        '''当前用户信息'''
        req = Request(ServerUrl.get_current_user_url, headers=cookie)
        return req.get()

    @classmethod
    def per_user_query(cls, cookie):
        '''个人用户查询情况'''
        req = Request(ServerUrl.per_user_query_url, headers=cookie)
        return req.get()

    @classmethod
    def ent_user_query(cls, cookie):
        '''企业用户查询情况'''
        req = Request(ServerUrl.ent_user_query_url, headers=cookie)
        return req.get()

    @classmethod
    def per_getusershortcut(cls, cookie):
        '''个人-信息提示'''
        req = Request(ServerUrl.per_getusershortcut_url, headers=cookie)
        return req.get()

    @classmethod
    def ent_getusershortcut(cls, cookie):
        '''企业-信息提示'''
        req = Request(ServerUrl.ent_getusershortcut_url, headers=cookie)
        return req.get()


if __name__ == "__main__":
    pass
